Release 10.1A: OpenEdge Development:
Programming Interfaces
Accessing Progress data
This section describes how to use HLC library functions to access Progress data. For example, you can use the
Caution: If you do not follow these guidelines, you can permanently damage your OpenEdge database.prordbi()function to read an integer field in a shared buffer. Use the following guidelines when accessing Progress data with HLC library functions.
- Use correct data types for the parameters you pass to HLC library functions. In general, C compilers do not verify whether the data types of the parameters you provide in a function call agree with the parameter data type definitions specified in the function declaration.
- Use correct values for the parameters you pass to HLC library functions. For example, HLC functions that access Progress shared buffers use the
fhandleparameter. Thefhandleparameter has the integer data type. You must setfhandlecorrectly to read from or write to the correct location in the buffer.- Use pointer variables properly. Many HLC library functions that access Progress use pointer variable parameters. Improper use of pointer variables can cause you to overwrite random locations in memory, with potentially hazardous results.
The following example demonstrates these guidelines by defining shared buffer
custbufwithin a 4GL procedure:
Later in your 4GL code, execute a
CALLstatement that calls a C function. Within the C function, you read the cust-num field. The cust-num field is an integer field in the customer table, for which shared buffer hlcbuff is defined, as follows:
The
prordbi()function reads an integer field contained in a shared buffer. To determine the HLC library function to use, see the function summary in Appendix C "HLC Library Function Reference."The
prordbi()function has the following syntax:
The
pbufnamparameter points to the name of the specified shared buffer. You supply the name from your OpenEdge application.The
fhandleinput parameter is the field handle thatprofldix()returns for the specified field.The
indexinput parameter specifies an index value for an array field. If the field is a scalar, you must set the value ofindexto 0.The
pvaroutput parameter points to a long whereprordbi()returns the value of the specified integer field.The
punknownoutput parameter points to an integer whereprordbi()returns 1 if the field has the Unknown value (?), and returns 0 otherwise.Figure 18–5 shows a call being made to
prordbi()that illustrates HLC programming guidelines:Figure 18–5: Example HLC library function call
![]()
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |